﻿@{
    ViewData["Title"] = "修改任务";
    Layout = "_Edit";
}
<article class="page-container">
    <form action="" method="post" class="form form-horizontal" id="form-add">
        <input type="hidden" class="input-text" value="@Model.ID" id="id" name="id">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">工作状态：</label>
            <div class="formControls col-xs-8 col-sm-9">
                 <input type="text" class="input-text" value="@Model.TaskState" placeholder="" id="t1" hidden>
                <span class="select-box">
                    <select class="select" size="1" name="taskState"   id="taskState"   >
                      
                            <option value="Initial">初始状态</option>
                            <option value="Executing" >执行中</option>
                            <option value="Finish" >完成</option>
                            <option value="ManualFinish" >手动完成</option>
                            <option value="Cancel" >取消</option>
                      
                                    
                     
                     </select>
                        </span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">当前节点状态：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="@Model.CurrentDetailTaskState" placeholder="" id="t2" hidden>
                 <span class="select-box">
                    <select class="select" size="1"  id="currentDetailTaskState" name="currentDetailTaskState" >
                      
                            <option value="Init">初始状态</option>
                            <option value="Executing">执行中</option>
                            <option value="Finish" >完成</option>
                        
                      
                                    
                     
                     </select>
                        </span>
            </div>
        </div>
            <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">当前节点目标货位：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="@Model.CurrentToCargo" placeholder="" id="currentToCargo" name="currentToCargo">
            </div>
        </div>
               <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">当前节点目标设备：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="@Model.CurrentToEquipment" placeholder="" id="currentToEquipment" name="currentToEquipment">
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">

                <input class="btn btn-primary radius" type="button" onclick="operate()" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</article>

@section javascript{

    <script>
        $("#currentDetailTaskState").val("@Model.CurrentDetailTaskState");
        $("#taskState").val( $("#t1").val());

        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });
        function operate() {
          console.log($("#form-add").serialize()) 

            SubmitFormForAjax("/worktaskinfo/UpWorkTaskStatus", $("#form-add").serialize(), function(data) {
                if (data.result) {
                    popupAlert('提交成功', 1, function() { closePageLayer(true); });
                } else {
                    popupAlert(data.message, 2, function(data) { layer.close(data); });
                }
            }, true);
        }

    </script>
}